#include<stdio.h>
#include<string.h>

const char key[] = {"Nian"};

int main()
{
	int Nian_count = 0, first_Nian_place = -1;
	char str[10001];
	gets(str);
	
	char *token = strtok(str, " ");
	
	for(int i = 0; token != NULL; i++)
	{
		if(strcmp(token, key) == 0)
		{
			Nian_count++;
			if(first_Nian_place == -1)
			{
				first_Nian_place = token - str; 
			}
		}
		token = strtok(NULL, " ");
	}
	
	printf("%d %d", Nian_count, first_Nian_place);
	
	return 0;
}

